<%--
  Created by IntelliJ IDEA.
  User: 老白
  Date: 2021/6/18
  Time: 12:26
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>后台管理页面左边列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css">
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<div class="accordion" id="accordionExample">
    <div class="card">
        <c:if test="${userInfo.username == 'admin'}">
            <div class="card-header" id="headingOne">
                <h2 class="mb-0">
                    <button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse"
                            data-target="#collapseOne"
                            aria-expanded="true" aria-controls="collapseOne">
                        图书管理
                    </button>
                </h2>
            </div>
        </c:if>


        <div id="collapseOne" class="collapse" aria-labelledby="headingOne" data-parent="#accordionExample">
            <div class="card-body">
                <div class="list-group  list-group-flush">
                    <a href="/modeBookAdd.jsp" class="list-group-item list-group-item-action">添加图书</a>
                    <a href="/book?type=findAll" class="list-group-item list-group-item-action">图书列表</a>
                </div>
            </div>
        </div>
    </div>
    <div class="card">
        <div class="card-header" id="headingTwo">

            <h2 class="mb-0">
                <button class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse"
                        data-target="#collapseTwo"
                        aria-expanded="false" aria-controls="collapseTwo">
                    借书管理
                </button>
            </h2>
        </div>
        <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionExample">
            <div class="card-body">

                <div class="list-group  list-group-flush">
                    <c:if test="${userInfo.username == 'admin'}">
                        <a href="/borrow?type=findAll" class="list-group-item list-group-item-action">借书记录(管理员)</a>
                    </c:if>
                    <a href="/borrow?type=userBorrowList&username=${userInfo.username}"
                       class="list-group-item list-group-item-action">借书记录</a>
                </div>


            </div>
        </div>
    </div>
    <div class="card">
        <div class="card-header" id="headingThree">
            <h2 class="mb-0">
                <button class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse"
                        data-target="#collapseThree"
                        aria-expanded="false" aria-controls="collapseThree">
                    订单管理
                </button>
            </h2>
        </div>
        <div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordionExample">
            <div class="card-body">
                <div class="list-group  list-group-flush">
                    <c:if test="${userInfo.username == 'admin'}">
                        <a href="/order?type=findAll" class="list-group-item list-group-item-action">订单记录(管理员)</a>
                    </c:if>
                    <a href="/order?type=userOrderList&username=${userInfo.username}"
                       class="list-group-item list-group-item-action">订单记录</a>
                </div>
            </div>
        </div>
    </div>
    <div class="card">
        <div class="card-header" id="headingfour">
            <h2 class="mb-0">
                <button class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse"
                        data-target="#collapsefour"
                        aria-expanded="false" aria-controls="collapsefour">
                    人员管理
                </button>
            </h2>
        </div>

        <div id="collapsefour" class="collapse show" aria-labelledby="headingfour" data-parent="#accordionExample">
            <div class="card-body">
                <div class="list-group  list-group-flush">
                    <a href="/index.jsp" class="list-group-item list-group-item-action">返回首页</a>
                    <c:if test="${userInfo.username == 'admin'}">
                        <a href="/user?type=findAll" class="list-group-item list-group-item-action">用户管理</a>
                    </c:if>
                    <a href="/user?type=userInfo&username=${userInfo.username}"
                       class="list-group-item list-group-item-action">个人信息管理</a>
                    <a href="/modeUserPass.jsp?username=${userInfo.username}"
                       class="list-group-item list-group-item-action">修改密码</a>
                    <a href="/user?type=logout" class="list-group-item list-group-item-action">退出登录</a>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
